package lv.dysnomia.portal.web

import java.io.IOException;
import javax.servlet.http.{ HttpServlet, HttpServletRequest, HttpServletResponse }
import com.google.appengine.api.blobstore.{ BlobKey, BlobstoreServiceFactory }

class ServeBlob extends HttpServlet {
  val blobstoreService = BlobstoreServiceFactory.getBlobstoreService

  override def doGet(request: HttpServletRequest, response: HttpServletResponse): Unit = {
    val blobKey = new BlobKey(request.getParameter("blob-key"))
    blobstoreService.serve(blobKey, response)
  }
}
